<template>
  <el-card>
    <div slot="header" class="card">
      <div class="search-header">
        <span>线上热门搜索</span>
        <el-dropdown>
          <span class="el-dropdown-link">
            <i class="el-icon-more"></i>
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>黄金糕</el-dropdown-item>
            <el-dropdown-item>狮子头</el-dropdown-item>
            <el-dropdown-item>螺蛳粉</el-dropdown-item>
            <el-dropdown-item>双皮奶</el-dropdown-item>
            <el-dropdown-item>蚵仔煎</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
    <el-row :gutter="10">
      <el-col :span="12">
        <LineChart />
      </el-col>
      <el-col :span="12">
        <LineChart />
      </el-col>
    </el-row>

    <!-- table表格 -->
    <el-table border
      :data="tableData"
      style="width: 100%; margin-top: 10px"
      :default-sort="{ prop: 'date', order: 'descending' }"
    >
      <el-table-column label="排名" width="80" type="index" align="center">
      </el-table-column>
      <el-table-column prop="name" label="搜索关键字" width="150">
      </el-table-column>
      <el-table-column prop="address" label="用户数" sortable>
      </el-table-column>
      <el-table-column prop="" label="周涨幅" sortable>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <el-pagination
        style="text-align: center"
        layout="prev, pager, next"
        :total="500">
    </el-pagination>
  </el-card>
</template>

<script>
import LineChart from "./lineChart";
export default {
  components: { LineChart },
  data() {
    return {
        tableData: [{
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }]
    }
  },
  methods: {
    formatter(row, column) {
        return row.address;
      }
  },
};
</script>

<style scoped>
.card {
  border-bottom: 1px solid #ccc;
  padding-bottom: 10px;
}
.search-header {
  display: flex;
  justify-content: space-between;
}
</style>